<?php $this->_extends('_layouts/blank_layout'); ?>

<?php $this->_block('title'); ?> - 主机管理<?php $this->_endblock(); ?>

<?php $this->_block('jscript'); ?>


<?php $this->_endblock('jscript'); ?>

<?php $this->_block('contents'); ?>

	<div id="getting-started">
	    <table>
		<tr><th width="30">编号</th><th>主机组</th></tr>
		<?php
		$table = new QDB_Table(array('name'=>'group'));
		$manages = $table ->select('id in ('.$allgroupstr.')')->getAll();
		
		foreach ($manages as $s){
			
			echo '<tr><td>'.$s['id'].'</td><td>'.$s['groupname'].'</td></tr><tr><td width="30"></td><td><div>
			<h5>下属主机</h5>
			<ul>';

			$table1 =QDB::getConn();
			$sql = "SELECT `hosttable`.*, `grouptohost`.`groupid`   FROM `hids`.`hosttable`  LEFT JOIN `grouptohost`   ON (grouptohost.hostid = hosttable.id)   WHERE ((grouptohost.groupid =".$s['id']."))   ORDER BY `hosttable`.`id` desc";
			$handel1 =$table1->execute($sql);
			$temp1 = $handel1->fetchAll();
			
			foreach ($temp1 as $s1){
				echo '<li><a href="index.php?controller=systemlog&mac='.$s1['macaddress'].'">'.$s1['hostname'].'</a></li>';
			}

			echo '</ul></div></td></tr>';
		}
		?>
		</table>
	</div>

<?php $this->_endblock('contents'); ?>